package com.gome.axwl.aoc.common.enumCode;


import java.util.HashMap;

/**
 * @Author John LI
 */
public class DatabaseStatusCode {

    public static final int ACTIVE = 1;

    public static final int INACTIVE = 0;

    private int code;

    private String name;

    private String description;

    public DatabaseStatusCode(int code, String name, String description) {
        this.code = code;
        this.name = name;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }


    private static HashMap<Integer, DatabaseStatusCode> databaseStatusCodeList = new HashMap<Integer, DatabaseStatusCode>() {

        private static final long serialVersionUID = 1L;

        {
            // 自定义错误类型
            put(ACTIVE, new DatabaseStatusCode(ACTIVE, "在职", "用户在职"));
            put(INACTIVE, new DatabaseStatusCode(INACTIVE, "离职", "用户已离职"));
        }
    };

    public static DatabaseStatusCode getDatabaseStatusCode(int code) {
        return databaseStatusCodeList.get(code);
    }
}